var Class = function(parent) {
	var klass = function() {
		this.init.apply(this, arguments);
	};
	// Change klass' prototype
	if (parent) {
		var subclass = function() {
		};
		subclass.prototype = parent.prototype;
		klass.prototype = new subclass;
		klass.parent = parent;
	}
	klass.prototype.init = function() {
	};
	// Shortcuts
	klass.fn = klass.prototype;
	klass.fn.klass = klass;
	klass._super = klass.__proto__;

	// Adding class properties
	klass.extend = function(obj) {
		var extended = obj.extended;
		for ( var i in obj) {
			klass[i] = obj[i];
		}
		if (extended)
			extended(klass);
	};

	// Adding instance properties
	klass.include = function(obj) {
		var included = obj.included;
		for ( var i in obj) {
			klass.fn[i] = obj[i];
		}
		if (included)
			included(klass);
	};

	klass.proxy = function(func) {
		var self = this;
		return (function() {
			return func.apply(self, arguments);
		});
	};
	// Add the function on instances too
	klass.fn.proxy = klass.proxy;

	klass.isSubClass = function(obj) {
		var p = klass.parent;
		while (p) {
			if (p === obj) {
				return true;
			}
			p = p.parent;
		}
		return false;
	};
	return klass;
};